//
//  XmlRpc.h
//  MobilCommunity
//
//  Created by easystudio on 7/11/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@class XmlRequestBody;

@interface XmlRpc : NSObject {
    XmlRequestBody *xmlRequestBody;
    
    id result;
    NSMutableArray* response;

}
@property (retain) id result;


//@property (nonatomic, retain) NSMutableArray* response;
@property (nonatomic, assign) NSMutableArray* response;


-(NSMutableArray *)SendRequest:(NSString *)methodName params:(NSMutableDictionary *)requestParams;
-(NSMutableArray *)SendRequestNoFilter:(NSString *)methodName params:(NSMutableDictionary *)requestParams;

//More
-(NSMutableDictionary *) Member_Login:(NSString *)userName PassWord:(NSString *)passWord Origin:(NSString *)origin;

-(NSString *)Mail_GetNewMailCount:(NSString *)userName SessionId:(NSString *)sessionid;

-(NSMutableArray *) GetMemberPosi;
-(void) SaveFeedBack:(NSMutableDictionary *)content ;
//获取新版本
-(NSMutableDictionary *) GetNewVersion;
//从Portal获取url
-(NSString *) GetSubURLFromPortal:(NSString *)company_code;


//Mission
-(NSMutableDictionary *) GetMsgCount:(NSString *)user_id PosiID:(NSString *)posi_id Type:(NSString *)msg_type;
-(NSMutableArray *) GetMsgList:(NSString *)user_id msgType:(NSString *)msg_type searchType:(NSString *)search_type searchWord:(NSString *)search_word posiId:(NSString *)posi_id startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
//
-(NSMutableDictionary *) SetMsgRead:(NSString *)msg_id Type:(NSString *)msg_type IsRead:(NSString *)is_read;

//  //Approve
-(NSMutableArray *) GetApproveList:(NSString *)role_id posiId:(NSString *)posi_id startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
-(NSMutableDictionary *) GetApproveInfo:(NSString *)approveid;

-(void) SendAgreeDisallow:(NSMutableDictionary *)content ;

-(NSMutableArray *) GetApproveHistoryList:(NSString *)order_id tableName:(NSString *)table_name WorkFlowId:(NSString *)workflow_id;

-(int) GetApproveListCount:(NSString *)role_id posiId:(NSString *)posi_id;



//Customer
-(NSMutableArray *) GetCustomerList:(NSString *)employeeid PosiID:(NSString *)positionid startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) GetSearchCustomerList:(NSString *)employeeid PosiID:(NSString *)positionid Type:(NSString *)type searchWord:(NSString *)searchword startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(void) SaveCustomerContract:(NSMutableDictionary *)contactDict ;
-(void) SaveNewCustomer:(NSMutableDictionary *)customerDict ;

-(NSMutableArray *) GetCustPictureList:(NSString *)custid;


-(NSMutableDictionary *) GetCustomerInfo:(NSString *)custid;
//Jason
-(NSMutableArray *) GetCustContractList:(NSString *)custid;
-(NSMutableArray *) GetCustPortList:(NSString *)custid;
-(NSMutableArray *) GetCustDocketsList:(NSString *)custid;

-(NSMutableArray *) GetCustomerOriginList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
-(NSMutableArray *) GetCustomerTypeList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
-(NSMutableArray *) GetCustomerCreditList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;


//Produt
-(NSMutableArray *) GetProductList:(NSString *)userid startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

//saveNewProduct
-(void) SaveNewProduct:(NSMutableDictionary *)productDict;

-(NSMutableArray *) GetProductPictureList:(NSString *)product_id startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableDictionary *) GetProduct:(NSString *)product_id;

-(NSMutableArray *) GetSearchProductList:(NSString *)user_id searchCondition:(NSString *)p_search searchType:(NSString *)search_type startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

//产品类别
-(NSMutableArray *) GetProductCategoryList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) GetSearchProductCategoryList:(NSString *)p_search startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

//产品单位
-(NSMutableArray *) GetProductUnitList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) GetSearchProductUnitList:(NSString *)p_search startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

//产品海关编码
-(NSMutableArray *) GetProductCustomsCodeList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) GetSearchProductCustomsCodeList:(NSString *)p_search startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) GetProductSupplierList:(NSString *)product_id;

-(NSMutableArray *) GetProductConversionRateList:(NSString *)product_id;

-(NSMutableArray *) GetProductAssemblyList:(NSString *)product_id;

-(NSMutableArray *) GetProductCustomList:(NSString *)product_id;

-(NSMutableArray *) GetProductPackingList:(NSString *)product_id;


//Quotation
-(NSMutableArray *) GetQuotationList:(NSString *)userId period:(NSString *) period positionID:(NSString *)positionId startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableDictionary *) GetQuotationBasic:(NSString *)quotationid;
-(NSMutableDictionary *) GetQuotationOffer:(NSString *)quotationid;
-(NSMutableArray *) GetQuotationProductList:(NSString *)quotationid startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

//-(NSMutableArray *) GetSearchQuotationList:(NSString *)p_search startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
-(NSMutableArray *) GetSearchQuotationList:(NSString *)p_search Type:(NSString *)type startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) GetQuotationProductList:(NSString *)price_quote_no;

-(NSMutableArray *) GetCostModel:(NSString *)quot_id;
//@"币种"
-(NSMutableArray *) GetCurrencyTypeList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
//@"起运港"
-(NSMutableArray *) GetPortList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
//@"价格条款"
-(NSMutableArray *) GetPriceClauseTypeList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
//cbmx
-(NSMutableArray *) GetCostModelList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

//报价单位
-(NSMutableArray *) GetQuotProductUnitList:(NSString *)prod_id startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(void) InsertQuotationBasic:(NSMutableDictionary *)quotion;
-(void) InsertQuotationProduct:(NSMutableDictionary *)quotion_product;


//Chance
-(NSMutableArray *) GetChanceList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableDictionary *) GetChance:(NSString *)chance_id;
-(NSMutableArray *) GetSearchChanceList:(NSString *)p_search searchType:(NSString *)search_type startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(int) isUseBusinessChance;

-(void) InsertChanceChance:(NSMutableDictionary *)chance;


//mail

/*
 得到邮件列表
 */
-(NSMutableArray *) getMailList:(NSString *)employee_id box:(NSString *)box startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
/*
 得到一条具体的详细信息
 */
-(NSMutableDictionary *) getMailDetails:(NSString *)shareID mailId:(NSString*)mailId useID:(NSString*)useID employee_id:(NSString *)employee_id box:(NSString *)box startRows:(NSString *)startrows;

-(NSMutableDictionary *) getMailDetailsShow:(NSString *)shareID;

/*
 得到NEXT PRIOR一条具体的详细信息
 */
-(NSMutableDictionary *)GetNextPriorDetailMail:(NSString *)employee_id box:(NSString *)box startRows:(NSString *)startrows;
/*
 设置重要性标志
 */
-(BOOL) settingMailImportantFlag:(NSString *)mail_id employId:(NSString *)employee_id importantFlag:(NSString *)importantFlag;
/*
 得到业务员列表
 */
-(NSMutableArray *) getEmployeeList:(NSString *)strPosID;
/*
 发送邮件
 */
-(void) sendNewMail:(NSMutableDictionary *)newMailData;
/*
 保存邮件
 */
-(void) saveNewMail:(NSMutableDictionary *)newMailData;
/*
 保存合并邮件
 */
-(NSMutableDictionary*) settingMultiMerger:(NSMutableDictionary *)mailMergeParam;
/*
 删除邮件
 */
-(BOOL) deleteMail:(NSString *)mailShareid;
/*
 得到客户列表
 */
-(NSMutableArray *) getMailCustomerList:(NSString *)employee_id positionID:(NSString *)positionid startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

/*
 设置已经读标志
 */
-(BOOL) settingMailReadFlag:(NSString *)mailShareID;

/*
 得到邮箱未读数量
 */
-(int) getMailByBoxCountNoRead:(NSString*)employee_id boxType:(NSString*)boxType;
/*
 根据主题和发件人名字进行搜索
 */
-(NSMutableArray *)getSearchMailList:(NSString*)employee_id boxType:(NSString*)boxType  search_condition:(NSString*)search_condition search_type:(NSString*)search_type startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

/*
 得到客户邮件列表
 */

-(NSMutableArray *) getCustomerMailList:(NSString *)employee_id customer_id:(NSString *)customer_id box:(NSString *)box startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

-(NSMutableArray *) getSearchCustomerMailList:(NSString*)employee_id customer_id:(NSString*)customer_id boxType:(NSString*)boxType  search_condition:(NSString*)search_condition search_type:(NSString*)search_type startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;
/*
 得到收件人，抄送人列表
 */
-(NSMutableArray *) getContactorlist:(NSString *)employee_id startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

/*
 查找收件人，抄送人列表
 */
-(NSMutableArray *) getSearchContactorList:(NSString *)employee_id search_condition:(NSString*)search_condition search_type:(NSString *)search_type startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

/*
 取得第一个客户邮件的列表
 */
-(NSMutableArray *)getFirstCustomerMailList:(NSString *)employee_id positionID:(NSString *)positionid boxType:(NSString*)boxType startRows:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

/*
 更新当前的经纬度到服务器
 */
-(NSMutableArray *) updateCurrentPoint:(NSString*)latitude longitude:(NSString*)longitude currentTime:(NSString*)currentTime;

//Employe
-(NSMutableArray *) GetEmployeList:(NSString *)startrows rowsPerPage:(NSString *)rowsperpage;

@end
